<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>methods实现原理</title>
    <!-- 引入我们自己的vue.js -->
    <script src="../js/myvue.js"></script>
</head>
<body>
    <!-- vue程序 -->
    <script>
        const vm = new Vue({
            data : {
                msg : 'hello vue!'
            },
            methods : {
                sayHi(){
                    //console.log(this === vm)
                    console.log(this.msg)
                    //alert('hi')
                },
                sayHello(){
                    alert('hello')
                },
                sayWhat : () => {
                    //console.log(this === vm)
                    console.log(this)
                }
            }
        })
        
    </script>
</body>
</html>